/*
Copyright 2007 Nathan Baker

This file is part of XAliens.

XAliens is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

XAliens is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with XAliens.  If not, see <http://www.gnu.org/licenses/>.
 */

package utils;

import java.awt.*;

public class BoundsRect extends Rectangle {
    private static final long serialVersionUID = -7423583523010564376L;

    /**
     * Creates a new BoundsRect with a specified x, y, width and height. The
     * purpose of BoundsRect is to determine the boundaries of the game play
     * area.
     *
     * @param x      The x coordinate of the BoundsRect.
     * @param y      The y coordinate of the BoundsRect.
     * @param width  The width of the BoundsRect.
     * @param height The height of the BoundsRect.
     */
    public BoundsRect(int x, int y, int width, int height) {
        super(x, y, width, height);
    }

    /**
     * Gets the right (x + width) of the BoundsRect.
     *
     * @return The right coordinate of the BoundsRect.
     */
    public int getRight() {
        return (int) (getWidth() + getX());
    }

    /**
     * Gets the bottom of the BoundsRect.
     *
     * @return The bottom coordinate of the BoundsRect.
     */
    public int getBottom() {
        return (int) (getHeight() + getY());
    }
}
